.class Lframent/SearchInShop$3;
.super Ljava/lang/Object;
.source "SearchInShop.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lframent/SearchInShop;->getHttpSearchGoodsData(Ljava/lang/String;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lframent/SearchInShop;

.field private final synthetic val$search_key:Ljava/lang/String;


# direct methods
.method constructor <init>(Lframent/SearchInShop;Ljava/lang/String;)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lframent/SearchInShop$3;->this$0:Lframent/SearchInShop;

    iput-object p2, p0, Lframent/SearchInShop$3;->val$search_key:Ljava/lang/String;

    .line 186
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 12

    .prologue
    .line 190
    new-instance v10, Ljava/lang/StringBuilder;

    iget-object v11, p0, Lframent/SearchInShop$3;->this$0:Lframent/SearchInShop;

    # getter for: Lframent/SearchInShop;->m:Lmyapp/MyApp;
    invoke-static {v11}, Lframent/SearchInShop;->access$4(Lframent/SearchInShop;)Lmyapp/MyApp;

    move-result-object v11

    invoke-virtual {v11}, Lmyapp/MyApp;->getWebConfig()Ljava/lang/String;

    move-result-object v11

    invoke-static {v11}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v11

    invoke-direct {v10, v11}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v11, "/index.php?ctrl=app&action=stroresearchlist&shopid="

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    iget-object v11, p0, Lframent/SearchInShop$3;->this$0:Lframent/SearchInShop;

    # getter for: Lframent/SearchInShop;->shopid:Ljava/lang/String;
    invoke-static {v11}, Lframent/SearchInShop;->access$5(Lframent/SearchInShop;)Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    const-string v11, "&searchname="

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    iget-object v11, p0, Lframent/SearchInShop$3;->val$search_key:Ljava/lang/String;

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    const-string v11, "&datatype=json"

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v10

    invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v9

    .line 191
    .local v9, "url":Ljava/lang/String;
    const-string v10, "search_goodsurl-----------"

    invoke-static {v10, v9}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 192
    iget-object v10, p0, Lframent/SearchInShop$3;->this$0:Lframent/SearchInShop;

    # getter for: Lframent/SearchInShop;->m:Lmyapp/MyApp;
    invoke-static {v10}, Lframent/SearchInShop;->access$4(Lframent/SearchInShop;)Lmyapp/MyApp;

    move-result-object v10

    invoke-static {v9, v10}, LPlugclass/HttpConn;->getStr(Ljava/lang/String;Lmyapp/MyApp;)Ljava/lang/String;

    move-result-object v8

    .line 195
    .local v8, "str":Ljava/lang/String;
    :try_start_0
    new-instance v5, Lorg/json/JSONObject;

    invoke-direct {v5, v8}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 197
    .local v5, "object":Lorg/json/JSONObject;
    const-string v10, "error"

    invoke-virtual {v5, v10}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    const-string v11, "true"

    invoke-virtual {v10, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v10

    if-eqz v10, :cond_0

    .line 199
    new-instance v4, Landroid/os/Message;

    invoke-direct {v4}, Landroid/os/Message;-><init>()V

    .line 200
    .local v4, "message":Landroid/os/Message;
    const/4 v10, 0x1

    iput v10, v4, Landroid/os/Message;->arg1:I

    .line 201
    const-string v10, "msg"

    invoke-virtual {v5, v10}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    iput-object v10, v4, Landroid/os/Message;->obj:Ljava/lang/Object;

    .line 202
    iget-object v10, p0, Lframent/SearchInShop$3;->this$0:Lframent/SearchInShop;

    # getter for: Lframent/SearchInShop;->h:Landroid/os/Handler;
    invoke-static {v10}, Lframent/SearchInShop;->access$6(Lframent/SearchInShop;)Landroid/os/Handler;

    move-result-object v10

    invoke-virtual {v10, v4}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    .line 253
    .end local v5    # "object":Lorg/json/JSONObject;
    :goto_0
    return-void

    .line 208
    .end local v4    # "message":Landroid/os/Message;
    .restart local v5    # "object":Lorg/json/JSONObject;
    :cond_0
    const-string v10, "msg"

    invoke-virtual {v5, v10}, Lorg/json/JSONObject;->isNull(Ljava/lang/String;)Z

    move-result v10

    if-eqz v10, :cond_1

    .line 209
    new-instance v4, Landroid/os/Message;

    invoke-direct {v4}, Landroid/os/Message;-><init>()V

    .line 210
    .restart local v4    # "message":Landroid/os/Message;
    const/4 v10, 0x2

    iput v10, v4, Landroid/os/Message;->arg1:I

    .line 211
    iget-object v10, p0, Lframent/SearchInShop$3;->this$0:Lframent/SearchInShop;

    # getter for: Lframent/SearchInShop;->h:Landroid/os/Handler;
    invoke-static {v10}, Lframent/SearchInShop;->access$6(Lframent/SearchInShop;)Landroid/os/Handler;

    move-result-object v10

    invoke-virtual {v10, v4}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    .line 215
    .end local v4    # "message":Landroid/os/Message;
    :cond_1
    const-string v10, "msg"

    invoke-virtual {v5, v10}, Lorg/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v6

    .line 217
    .local v6, "object2":Lorg/json/JSONObject;
    const-string v10, "goodssearchlist"

    invoke-virtual {v6, v10}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v3

    .line 219
    .local v3, "jsonArray":Lorg/json/JSONArray;
    const/4 v2, 0x0

    .local v2, "i":I
    :goto_1
    invoke-virtual {v3}, Lorg/json/JSONArray;->length()I

    move-result v10

    if-lt v2, v10, :cond_2

    .line 236
    new-instance v4, Landroid/os/Message;

    invoke-direct {v4}, Landroid/os/Message;-><init>()V

    .line 237
    .restart local v4    # "message":Landroid/os/Message;
    const/4 v10, 0x4

    iput v10, v4, Landroid/os/Message;->arg1:I

    .line 238
    iget-object v10, p0, Lframent/SearchInShop$3;->this$0:Lframent/SearchInShop;

    # getter for: Lframent/SearchInShop;->h:Landroid/os/Handler;
    invoke-static {v10}, Lframent/SearchInShop;->access$6(Lframent/SearchInShop;)Landroid/os/Handler;

    move-result-object v10

    invoke-virtual {v10, v4}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 240
    .end local v2    # "i":I
    .end local v3    # "jsonArray":Lorg/json/JSONArray;
    .end local v4    # "message":Landroid/os/Message;
    .end local v5    # "object":Lorg/json/JSONObject;
    .end local v6    # "object2":Lorg/json/JSONObject;
    :catch_0
    move-exception v1

    .line 241
    .local v1, "e":Lorg/json/JSONException;
    invoke-virtual {v1}, Lorg/json/JSONException;->printStackTrace()V

    .line 243
    new-instance v4, Landroid/os/Message;

    invoke-direct {v4}, Landroid/os/Message;-><init>()V

    .line 244
    .restart local v4    # "message":Landroid/os/Message;
    const/4 v10, 0x3

    iput v10, v4, Landroid/os/Message;->arg1:I

    .line 245
    iget-object v10, p0, Lframent/SearchInShop$3;->this$0:Lframent/SearchInShop;

    # getter for: Lframent/SearchInShop;->h:Landroid/os/Handler;
    invoke-static {v10}, Lframent/SearchInShop;->access$6(Lframent/SearchInShop;)Landroid/os/Handler;

    move-result-object v10

    invoke-virtual {v10, v4}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    goto :goto_0

    .line 220
    .end local v1    # "e":Lorg/json/JSONException;
    .end local v4    # "message":Landroid/os/Message;
    .restart local v2    # "i":I
    .restart local v3    # "jsonArray":Lorg/json/JSONArray;
    .restart local v5    # "object":Lorg/json/JSONObject;
    .restart local v6    # "object2":Lorg/json/JSONObject;
    :cond_2
    :try_start_1
    invoke-virtual {v3, v2}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v7

    .line 221
    .local v7, "object3":Lorg/json/JSONObject;
    new-instance v0, Lbean/GoodsBean;

    invoke-direct {v0}, Lbean/GoodsBean;-><init>()V

    .line 222
    .local v0, "bean":Lbean/GoodsBean;
    const-string v10, "name"

    invoke-virtual {v7, v10}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v0, v10}, Lbean/GoodsBean;->setname(Ljava/lang/String;)V

    .line 223
    const-string v10, "id"

    invoke-virtual {v7, v10}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v0, v10}, Lbean/GoodsBean;->setId(Ljava/lang/String;)V

    .line 224
    const-string v10, "count"

    invoke-virtual {v7, v10}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v0, v10}, Lbean/GoodsBean;->setcounts(Ljava/lang/String;)V

    .line 225
    const-string v10, "img"

    invoke-virtual {v7, v10}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v0, v10}, Lbean/GoodsBean;->setimg(Ljava/lang/String;)V

    .line 226
    const-string v10, "product_attr"

    invoke-virtual {v7, v10}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v0, v10}, Lbean/GoodsBean;->setAttr(Ljava/lang/String;)V

    .line 227
    const-string v10, "cost"

    invoke-virtual {v7, v10}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    invoke-static {v10}, Ljava/lang/Float;->valueOf(Ljava/lang/String;)Ljava/lang/Float;

    move-result-object v10

    invoke-virtual {v10}, Ljava/lang/Float;->floatValue()F

    move-result v10

    invoke-virtual {v0, v10}, Lbean/GoodsBean;->setcost(F)V

    .line 228
    const-string v10, "opentype"

    invoke-virtual {v7, v10}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v0, v10}, Lbean/GoodsBean;->settypeid(Ljava/lang/String;)V

    .line 229
    const-string v10, "sellcount"

    invoke-virtual {v7, v10}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v0, v10}, Lbean/GoodsBean;->setsellcount(Ljava/lang/String;)V

    .line 230
    const-string v10, "have_det"

    invoke-virtual {v7, v10}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v10

    invoke-virtual {v0, v10}, Lbean/GoodsBean;->setHave_det(Ljava/lang/String;)V

    .line 232
    iget-object v10, p0, Lframent/SearchInShop$3;->this$0:Lframent/SearchInShop;

    # getter for: Lframent/SearchInShop;->goodsBeans:Ljava/util/List;
    invoke-static {v10}, Lframent/SearchInShop;->access$7(Lframent/SearchInShop;)Ljava/util/List;

    move-result-object v10

    invoke-interface {v10, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_0

    .line 219
    add-int/lit8 v2, v2, 0x1

    goto/16 :goto_1
.end method
